/**
 * Project Name:wwe
 * File Name:UserController.java
 * Package Name:pers.billson.wwe.user.web
 * Date:2017年4月5日下午10:18:59
 * Copyright ©2017, billson0618@163.com All Rights Reserved.
 *
*/

package pers.billson.wwe.user.web;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import pers.billson.wwe.user.entity.User;
import pers.billson.wwe.user.service.UserService;

/**
 * Discription: 用户控制器 <br/>
 *
 * @author Billson
 * @date 2017年4月5日 下午10:18:59
 */
@Controller
@RequestMapping("/user")
public class UserController {

	private final Logger LOG = LoggerFactory.getLogger(this.getClass());
	@Autowired
	private UserService userService;

	@RequestMapping(value = "/list", method = RequestMethod.GET)
	public String list(Model model) {
		LOG.info("调用--------/user/list");
		List<User> list = userService.listAll();
		model.addAttribute("userList", list);
		return "user/userList";
	}
}
